{*******************************************************************************
   FINALIDADE: Exibir uma caixa de dialogo, podendo ser alterado o titulo e mensagem
               do forme
*******************************************************************************}

unit aviso;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, ExtCtrls, StdCtrls, Buttons;

type
  Tfrmaviso = class(TForm)
    Panel1: TPanel;
    BitBtn1: TBitBtn;
    BitBtn2: TBitBtn;
    Bevel1: TBevel;
    Memo1: TMemo;
    procedure BitBtn1Click(Sender: TObject);
    procedure BitBtn2Click(Sender: TObject);
    procedure FormShow(Sender: TObject);
    procedure Memo1Enter(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
    Constructor Create (AOwner: TComponent; Titulo:String; Mensagem:String); reintroduce;
  end;

var
  frmaviso: Tfrmaviso;
  botao_aviso:string;

implementation

{$R *.dfm}

constructor Tfrmaviso.Create(AOwner: TComponent;
                             Titulo:String; Mensagem:String);
begin
  inherited Create(AOwner);      // Chama o construtor da classe base
  Caption         := Titulo;     // Recebe o titulo a ser exibido no formularo
  Memo1.Text      := Mensagem;   // Recebe a mensagem a ser exibida
end;

procedure Tfrmaviso.BitBtn1Click(Sender: TObject);
begin
  ModalResult := mrOK;  
end;

procedure Tfrmaviso.BitBtn2Click(Sender: TObject);
begin
  ModalResult := mrCancel;
end;

procedure Tfrmaviso.FormShow(Sender: TObject);
begin
  BitBtn2.setfocus;
end;


procedure Tfrmaviso.Memo1Enter(Sender: TObject);
begin
  SelectNext(ActiveControl as TWinControl, true, true );
end;

end.
